<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ include file="/base/base.jsp"%>
<%@ include file="/base/database.jsp" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport"
	content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<meta name="renderer" content="webkit">
<title>学生名单</title>
<link rel="stylesheet" href="css/pintuer.css">
<link rel="stylesheet" href="css/admin.css">
<link rel="shortcut icon" href="images/logo.jpg">
<script src="js/jquery.js"></script>
<script src="js/pintuer.js"></script>

</head>

<body>

  <div class="panel admin-panel">
    <div class="panel-head"><strong class="icon-reorder">学生名单</strong> </div>
    <div class="padding border-bottom">
      <ul class="search" style="padding-left:10px;">
       <li><a href="page/student/student_add.jsp" class="button border-main icon-search"> 添加学生</a></li>
        <li style="color:blue;font-size:16px;">按学生学号搜索：</li>
       <form method="post" action="page/student/action_searchstudent.jsp">
       
          <input type="text" placeholder="请输入搜索关键字" name="stuID" class="input" style="width:250px; line-height:17px;display:inline-block" value="201700208517" />
          <input type="submit" class="panel-head" value="查询" style="font-size:15pt"></form>
			 
      </ul>
    </div>
    <table class="table table-hover text-center">
      <tr>
       			<th>序号</th>
       			<th>学号</th>
				<th>班号</th>
				<th>姓名</th>
				<th>性别</th>
				<th>通讯地址</th>
				<th>学生电话</th>
				<th>联系人</th>
				<th>联系人电话</th>
				<th>操作</th>
      </tr>
    
				
				
		
			<%  
			    request.setCharacterEncoding("utf-8");
			    
			    String  keyword=request.getParameter("keyword");
			
				StringBuffer sqlBuff = new StringBuffer();
				sqlBuff.append("select * from sys_student limit 1,5");
				String sql = sqlBuff.toString();
			
				Connection conn = getConn();
		
				PreparedStatement pstmt = conn.prepareStatement(sql);


				ResultSet rs = pstmt.executeQuery();
		
				int index = 1;
				while (rs.next()) {
					
				String stuID=rs.getNString("stuID");
				String classID=rs.getNString("classID");								
				String stuName=rs.getNString("stuName");			
				String sex=rs.getNString("sex");
				String address=rs.getNString("address");
				String stuTel=rs.getString("stuTel");
				String contact=rs.getNString("contact");
				String contactTel=rs.getNString("contactTel");
			%>

			<tr>
				 <td><%=index++ %></td>
				<td><%=stuID%></td>
				<td><%=classID%></td>
				<td><%=stuName %></td>
				<td><%=sex%></td>
				<td><%=address %></td>				
				<td><%=stuTel%></td>
				<td><%=contact %></td>				
				<td><%=contactTel%></td>
				<td><div class="button-group">
				 <a class="button border-main" href="<%=path%>/page/student/student_edit.jsp?stuID=<%=stuID%>"><span class="icon-edit"></span> 修改</a> <a class="button border-red" href="<%=path%>/page/student/action_delstudent.jsp?stuID=<%=stuID%>" ><span class="icon-trash-o"></span> 删除</a>  </div></td>
			</tr>
			<%
				}
			%>
    </table>
  </div>
  <div class="pagelist"> <a href="page/student/student_list.jsp">上一页</a>
  <span class="current"><select name="tern" onchange="window.location=this.value">
  <option>跳页</option>
  <option value="student_list.jsp">1</option>
  <option value="student_page2.jsp">2</option>
  <option value="student_page3.jsp">3</option>
  </select></span> <span class="current">1</span><a href="page/student/student_page2.jsp">2</a><a href="page/student/student_page3.jsp">3</a><a href="page/student/student_page2.jsp">下一页</a><a href="page/student/student_page3.jsp">尾页</a> </div>

</body>
</html>
